<!DOCTYPE html>
<html lang="en" ng-app="AldeasInfantiles" >
  <head>
    <title>Aldeas Infantiles | Administrar Programas</title>
    <?php
		  $this->load->view('head_view');
    ?>
    <script src="<?php echo base_url("assets/js/dorps-view.js"); ?>"></script>
    <script src="<?php echo base_url("assets/js/menu-view.js"); ?>"></script>
  </head>

<body>

  <div class="container">
    <div class="masthead">
      <?php
        $this->load->view('nav_view');
      ?>
    </div>
    <div class="jumbotron" ng-controller="Dorps">
      <form class="form-horizontal" role="form" id="form-edit-dorp">
        <h4>Editar Programas <span class="glyphicon glyphicon-globe"></span></h4>
        <div class="row">
          <div class="col-xs-4">
            <label for="add-dorps-search" class="col-sm-12 control-label">Buscar:</label>
          </div>
          <div class="col-xs-4">
            <a href="#" data-toggle="modal" data-target="#modal-dorps" ng-click="showDorps()"><span class="glyphicon glyphicon-search"></span> Buscar</a>
          </div>
        </div>
        <div class="row hide">
          <div class="col-xs-4">
            <label for="donorid" class="col-sm-12 control-label">Identificador:</label>
          </div>
          <div class="col-xs-4">
            <input type="text" class="form-control" ng-model="dorp.dorpid" id="dorp.dorpid" name="dorp.dorpid" disabled>
          </div>
        </div>
        <div class="row">
          <div class="col-xs-4">
            <label for="selectedCountry" class="col-sm-12 control-label">Pa&iacute;s</label>
          </div>
          <div class="col-xs-4">
            <select id="selectedCountry" name="selectedCountry" class="form-control" title="Seleccione el pa&iacute;s del usuario"
              ng-model="selectedCountry"
              ng-options="country.id_pais as country.ds_pais for country in countries"
              >
            </select>
          </div>
        </div>
        <div class="row">
          <div class="col-xs-4">
            <label for="add-dorps-name" class="col-sm-12 control-label">Nombre:</label>
          </div>
          <div class="col-xs-4">
            <input type="text" class="form-control" ng-model="dorp.dorpname" id="dorp.dorpname" name="dorp.dorpname" placeholder="Nombre" title="Escriba el nombre del programa" required>
          </div>
        </div>
        <div class="row">
          <div class="col-xs-4">
            <label for="add-dorp-dir" class="col-sm-12 control-label">Direcci&oacute;n</label>
          </div>
          <div class="col-xs-4">
            <textarea rows="2" cols="30" ng-model="dorp.dorpdir" id="dorp.dorpdir" name="dorp.dorpdir" title="Escriba la direcci&oacute;n del programa">
            </textarea>
          </div>
        </div>
        <div class="row">
          <div class="col-xs-4">
          </div>
          <div class="col-xs-4">
            <input type="reset" class="btn btn-default" value="Cancelar"  />
            <input type="submit" class="btn btn-primary" value="Guardar" ng-click="getParams(dorp)" />
            <div id="messages-users" class="alert alert-dismissable {{alertClass}} {{hiddenClass}}">
              <strong>Mensaje!</strong> <span>{{errorMessage}}</span>
            </div>
          </div>
        </div>
      </form>

      <div class="modal fade" id="modal-dorps" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title">Seleccione un donador</h4>
          </div>
              <div class="modal-body">
          <form class="form-horizontal" role="form" id="user-form">
            <div class="row">
              <div class="col-xs-2">
                <h5>Filtrar:</h5>
              </div>
              <div class="col-xs-4">
                <input type="text" class="form-control" placeholder="Nombre del donador" ng-model="query" id="userfilter" name="userfilter" value="" size="25" />
              </div>
            </div>
            <div class="list-group" role="navigation">
              <a ng-repeat="dorp in dorps | filter:query" ng-click="getDorpById(dorp, $event)" href="" class="list-group-item">{{dorp.ds_programa}}</a>
            </div>
          </form>
              </div>
            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
      </div>
    </div>
    <?php
      $this->load->view('footer_view');
    ?>
  </div>
</body>
</html>